﻿@model CommerceOne.Models.ViewModelBase
           
<!-- MODULE Block cart -->
<div id="cart_block" class="block exclusive">
    <h4>
        <a href="@Model.CartLink">Cart</a>
        <span id="block_cart_expand" class="hidden">&nbsp;</span> 
        <span id="block_cart_collapse">&nbsp;</span>
    </h4>
    <div class="block_content">
        <!-- block summary -->
        <div id="cart_block_summary" class="collapsed">
            <span class="ajax_cart_quantity">@Model.ItemNumber</span> 
            @if (Model.ItemNumber > 1)
            {
            <span class="ajax_cart_product_txt_s">products</span>
            }
            else if (Model.ItemNumber == 1)
            {
            <span class="ajax_cart_product_txt">product</span> 
            }
            else
            {
                <span class="ajax_cart_no_product">(empty)</span>
            }
            <span class="ajax_cart_total">@Model.TotalPrice.ToString("$#,##0.00")</span>
            
        </div>
        <!-- block list of products -->
        <div id="cart_block_list" class="expanded">
            @if (Model.Cart != null && Model.Cart.ProductLine != null)
            {
                for (int i = 0; i < Model.Cart.ProductLine.Count; i++ )
                {
                    var styleClass = "item";
                    if (i == 0) { styleClass = "first_item"; }
                    if (i == Model.Cart.ProductLine.Count - 1) { styleClass = "last_item"; }
                    var item = Model.Cart.ProductLine[i];
                    var shortName = item.Name.Length > 10 ? item.Name.Substring(0, 10) + "..." : item.Name;
                    <dl class="products">
                        <dt id="cart_block_product_19" class="@styleClass">
                        <span class="quantity-formated">
                        <span class="quantity">@item.Quantity</span>x</span> 
                            <a class="cart_block_product_name" href="@item.Url" title="@item.Name">@shortName</a>
                            <span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="http://livedemo00.template-help.com/prestashop_34916/cart.php?delete&amp;id_product=19&amp;ipa=0&amp;token=cdb0f7ccff01834d6226f69646336509"
                                title="remove this product from my cart">&nbsp;</a></span>
                                 <span class="price">@item.SubTotal.ToString("$#,##0.00")</span>
                        </dt>
                    </dl>
                }
            }
            else
            {
                <p id="cart_block_no_products">No products</p>
            }
                
            <div class="cart-prices">
                <div class="cart-prices-block">
                    <span>Shipping</span> <span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">@Model.ShippingCost.ToString("$#,##0.00")</span>
                </div>
                <div class="cart-prices-block">
                    <span>Total</span> <span id="cart_block_total" class="price ajax_block_cart_total">@Model.TotalPrice.ToString("$#,##0.00")</span>
                </div>
            </div>
            <p id="cart-price-precisions">
                Prices are tax excluded
            </p>
            <p id="cart-buttons">
                <a href="@Model.CartLink" class="btn_cart" title="Cart">Cart</a> 
                <a href="http://livedemo00.template-help.com/prestashop_34916/order.php?step=1" id="button_order_cart" class="btn_checkout" title="Check out">Check out</a>
            </p>
        </div>
    </div>
</div>
<!-- /MODULE Block cart -->
